package net.sparrow.gui.drawing;

import net.sparrow.Sparrow;
import net.sparrow.util.SpAnimation;
import net.sparrow.util.Util;

public class SpCoordAnimation extends SpScreenCoord{

	public SpAnimation xAnimation;
	public SpAnimation yAnimation;
	
	
	public SpCoordAnimation(Double ix, Double animWidth, Double iy, Double animHeight, Double animDuration, boolean act) {
		super(ix - animWidth, iy - animHeight);
		xAnimation = new SpAnimation(animDuration, animWidth);
		yAnimation = new SpAnimation(animDuration, animHeight);
		isActual = act;
	}
	public SpCoordAnimation(Double ix, Double iy) {
		super(ix, iy);
	}
	
	public Double getX() {
		return x + xAnimation.getValue();
	}
	
	public Double getY() {
		return y + yAnimation.getValue();
	}
	
	
	public SpScreenCoord asActualCoords() {
		if ( !isActual ) {
			return new SpScreenCoord(getX(), getY()).asActualCoords();
		}
		return this;
	}
	
	public SpScreenCoord asSpCoords() {
		if( isActual ) {
			return new SpScreenCoord(getX(), getY()).asSpCoords();
		}
		return this;
	}
	
	

	
	
}
